using System; 
using System.Text; 
using System.Data;
using System.Data.SqlClient;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration; 
using System.Xml; 
using System.Xml.Serialization;
using SubSonic; 
using SubSonic.Utilities;
namespace CXDB
{
	/// <summary>
	/// Strongly-typed collection for the CxStaffHr class.
	/// </summary>
    [Serializable]
	public partial class CxStaffHrCollection : ActiveList<CxStaffHr, CxStaffHrCollection>
	{	   
		public CxStaffHrCollection() {}
        
        /// <summary>
		/// Filters an existing collection based on the set criteria. This is an in-memory filter
		/// Thanks to developingchris for this!
        /// </summary>
        /// <returns>CxStaffHrCollection</returns>
		public CxStaffHrCollection Filter()
        {
            for (int i = this.Count - 1; i > -1; i--)
            {
                CxStaffHr o = this[i];
                foreach (SubSonic.Where w in this.wheres)
                {
                    bool remove = false;
                    System.Reflection.PropertyInfo pi = o.GetType().GetProperty(w.ColumnName);
                    if (pi.CanRead)
                    {
                        object val = pi.GetValue(o, null);
                        switch (w.Comparison)
                        {
                            case SubSonic.Comparison.Equals:
                                if (!val.Equals(w.ParameterValue))
                                {
                                    remove = true;
                                }
                                break;
                        }
                    }
                    if (remove)
                    {
                        this.Remove(o);
                        break;
                    }
                }
            }
            return this;
        }
		
		
	}
	/// <summary>
	/// This is an ActiveRecord class which wraps the CX_Staff_HR table.
	/// </summary>
	[Serializable]
	public partial class CxStaffHr : ActiveRecord<CxStaffHr>, IActiveRecord
	{
		#region .ctors and Default Settings
		
		public CxStaffHr()
		{
		  SetSQLProps();
		  InitSetDefaults();
		  MarkNew();
		}
		
		private void InitSetDefaults() { SetDefaults(); }
		
		public CxStaffHr(bool useDatabaseDefaults)
		{
			SetSQLProps();
			if(useDatabaseDefaults)
				ForceDefaults();
			MarkNew();
		}
        
		public CxStaffHr(object keyID)
		{
			SetSQLProps();
			InitSetDefaults();
			LoadByKey(keyID);
		}
		 
		public CxStaffHr(string columnName, object columnValue)
		{
			SetSQLProps();
			InitSetDefaults();
			LoadByParam(columnName,columnValue);
		}
		
		protected static void SetSQLProps() { GetTableSchema(); }
		
		#endregion
		
		#region Schema and Query Accessor	
		public static Query CreateQuery() { return new Query(Schema); }
		public static TableSchema.Table Schema
		{
			get
			{
				if (BaseSchema == null)
					SetSQLProps();
				return BaseSchema;
			}
		}
		
		private static void GetTableSchema() 
		{
			if(!IsSchemaInitialized)
			{
				//Schema declaration
				TableSchema.Table schema = new TableSchema.Table("CX_Staff_HR", TableType.Table, DataService.GetInstance("CXDB"));
				schema.Columns = new TableSchema.TableColumnCollection();
				schema.SchemaName = @"dbo";
				//columns
				
				TableSchema.TableColumn colvarId = new TableSchema.TableColumn(schema);
				colvarId.ColumnName = "ID";
				colvarId.DataType = DbType.Int32;
				colvarId.MaxLength = 0;
				colvarId.AutoIncrement = true;
				colvarId.IsNullable = false;
				colvarId.IsPrimaryKey = true;
				colvarId.IsForeignKey = false;
				colvarId.IsReadOnly = false;
				colvarId.DefaultSetting = @"";
				colvarId.ForeignKeyTableName = "";
				schema.Columns.Add(colvarId);
				
				TableSchema.TableColumn colvarUserID = new TableSchema.TableColumn(schema);
				colvarUserID.ColumnName = "userID";
				colvarUserID.DataType = DbType.Int32;
				colvarUserID.MaxLength = 0;
				colvarUserID.AutoIncrement = false;
				colvarUserID.IsNullable = true;
				colvarUserID.IsPrimaryKey = false;
				colvarUserID.IsForeignKey = false;
				colvarUserID.IsReadOnly = false;
				colvarUserID.DefaultSetting = @"";
				colvarUserID.ForeignKeyTableName = "";
				schema.Columns.Add(colvarUserID);
				
				TableSchema.TableColumn colvarDeptID = new TableSchema.TableColumn(schema);
				colvarDeptID.ColumnName = "DeptID";
				colvarDeptID.DataType = DbType.Int32;
				colvarDeptID.MaxLength = 0;
				colvarDeptID.AutoIncrement = false;
				colvarDeptID.IsNullable = true;
				colvarDeptID.IsPrimaryKey = false;
				colvarDeptID.IsForeignKey = false;
				colvarDeptID.IsReadOnly = false;
				colvarDeptID.DefaultSetting = @"";
				colvarDeptID.ForeignKeyTableName = "";
				schema.Columns.Add(colvarDeptID);
				
				TableSchema.TableColumn colvarTalkTime = new TableSchema.TableColumn(schema);
				colvarTalkTime.ColumnName = "TalkTime";
				colvarTalkTime.DataType = DbType.DateTime;
				colvarTalkTime.MaxLength = 0;
				colvarTalkTime.AutoIncrement = false;
				colvarTalkTime.IsNullable = true;
				colvarTalkTime.IsPrimaryKey = false;
				colvarTalkTime.IsForeignKey = false;
				colvarTalkTime.IsReadOnly = false;
				colvarTalkTime.DefaultSetting = @"";
				colvarTalkTime.ForeignKeyTableName = "";
				schema.Columns.Add(colvarTalkTime);
				
				TableSchema.TableColumn colvarTalkContent = new TableSchema.TableColumn(schema);
				colvarTalkContent.ColumnName = "TalkContent";
				colvarTalkContent.DataType = DbType.String;
				colvarTalkContent.MaxLength = 1073741823;
				colvarTalkContent.AutoIncrement = false;
				colvarTalkContent.IsNullable = true;
				colvarTalkContent.IsPrimaryKey = false;
				colvarTalkContent.IsForeignKey = false;
				colvarTalkContent.IsReadOnly = false;
				colvarTalkContent.DefaultSetting = @"";
				colvarTalkContent.ForeignKeyTableName = "";
				schema.Columns.Add(colvarTalkContent);
				
				TableSchema.TableColumn colvarPunishPartyTime = new TableSchema.TableColumn(schema);
				colvarPunishPartyTime.ColumnName = "Punish_party_time";
				colvarPunishPartyTime.DataType = DbType.DateTime;
				colvarPunishPartyTime.MaxLength = 0;
				colvarPunishPartyTime.AutoIncrement = false;
				colvarPunishPartyTime.IsNullable = true;
				colvarPunishPartyTime.IsPrimaryKey = false;
				colvarPunishPartyTime.IsForeignKey = false;
				colvarPunishPartyTime.IsReadOnly = false;
				colvarPunishPartyTime.DefaultSetting = @"";
				colvarPunishPartyTime.ForeignKeyTableName = "";
				schema.Columns.Add(colvarPunishPartyTime);
				
				TableSchema.TableColumn colvarPunishPartyType = new TableSchema.TableColumn(schema);
				colvarPunishPartyType.ColumnName = "Punish_party_type";
				colvarPunishPartyType.DataType = DbType.String;
				colvarPunishPartyType.MaxLength = 100;
				colvarPunishPartyType.AutoIncrement = false;
				colvarPunishPartyType.IsNullable = true;
				colvarPunishPartyType.IsPrimaryKey = false;
				colvarPunishPartyType.IsForeignKey = false;
				colvarPunishPartyType.IsReadOnly = false;
				colvarPunishPartyType.DefaultSetting = @"";
				colvarPunishPartyType.ForeignKeyTableName = "";
				schema.Columns.Add(colvarPunishPartyType);
				
				TableSchema.TableColumn colvarPunishPartyReason = new TableSchema.TableColumn(schema);
				colvarPunishPartyReason.ColumnName = "Punish_party_reason";
				colvarPunishPartyReason.DataType = DbType.String;
				colvarPunishPartyReason.MaxLength = 1073741823;
				colvarPunishPartyReason.AutoIncrement = false;
				colvarPunishPartyReason.IsNullable = true;
				colvarPunishPartyReason.IsPrimaryKey = false;
				colvarPunishPartyReason.IsForeignKey = false;
				colvarPunishPartyReason.IsReadOnly = false;
				colvarPunishPartyReason.DefaultSetting = @"";
				colvarPunishPartyReason.ForeignKeyTableName = "";
				schema.Columns.Add(colvarPunishPartyReason);
				
				TableSchema.TableColumn colvarPunishPenalTime = new TableSchema.TableColumn(schema);
				colvarPunishPenalTime.ColumnName = "Punish_penal_time";
				colvarPunishPenalTime.DataType = DbType.DateTime;
				colvarPunishPenalTime.MaxLength = 0;
				colvarPunishPenalTime.AutoIncrement = false;
				colvarPunishPenalTime.IsNullable = true;
				colvarPunishPenalTime.IsPrimaryKey = false;
				colvarPunishPenalTime.IsForeignKey = false;
				colvarPunishPenalTime.IsReadOnly = false;
				colvarPunishPenalTime.DefaultSetting = @"";
				colvarPunishPenalTime.ForeignKeyTableName = "";
				schema.Columns.Add(colvarPunishPenalTime);
				
				TableSchema.TableColumn colvarPunishPenalType = new TableSchema.TableColumn(schema);
				colvarPunishPenalType.ColumnName = "Punish_penal_type";
				colvarPunishPenalType.DataType = DbType.String;
				colvarPunishPenalType.MaxLength = 100;
				colvarPunishPenalType.AutoIncrement = false;
				colvarPunishPenalType.IsNullable = true;
				colvarPunishPenalType.IsPrimaryKey = false;
				colvarPunishPenalType.IsForeignKey = false;
				colvarPunishPenalType.IsReadOnly = false;
				colvarPunishPenalType.DefaultSetting = @"";
				colvarPunishPenalType.ForeignKeyTableName = "";
				schema.Columns.Add(colvarPunishPenalType);
				
				TableSchema.TableColumn colvarPunishPenalReason = new TableSchema.TableColumn(schema);
				colvarPunishPenalReason.ColumnName = "Punish_penal_reason";
				colvarPunishPenalReason.DataType = DbType.String;
				colvarPunishPenalReason.MaxLength = 1073741823;
				colvarPunishPenalReason.AutoIncrement = false;
				colvarPunishPenalReason.IsNullable = true;
				colvarPunishPenalReason.IsPrimaryKey = false;
				colvarPunishPenalReason.IsForeignKey = false;
				colvarPunishPenalReason.IsReadOnly = false;
				colvarPunishPenalReason.DefaultSetting = @"";
				colvarPunishPenalReason.ForeignKeyTableName = "";
				schema.Columns.Add(colvarPunishPenalReason);
				
				TableSchema.TableColumn colvarPartyProblem = new TableSchema.TableColumn(schema);
				colvarPartyProblem.ColumnName = "Party_Problem";
				colvarPartyProblem.DataType = DbType.String;
				colvarPartyProblem.MaxLength = 1073741823;
				colvarPartyProblem.AutoIncrement = false;
				colvarPartyProblem.IsNullable = true;
				colvarPartyProblem.IsPrimaryKey = false;
				colvarPartyProblem.IsForeignKey = false;
				colvarPartyProblem.IsReadOnly = false;
				colvarPartyProblem.DefaultSetting = @"";
				colvarPartyProblem.ForeignKeyTableName = "";
				schema.Columns.Add(colvarPartyProblem);
				
				TableSchema.TableColumn colvarOtherProblem = new TableSchema.TableColumn(schema);
				colvarOtherProblem.ColumnName = "Other_Problem";
				colvarOtherProblem.DataType = DbType.String;
				colvarOtherProblem.MaxLength = 1073741823;
				colvarOtherProblem.AutoIncrement = false;
				colvarOtherProblem.IsNullable = true;
				colvarOtherProblem.IsPrimaryKey = false;
				colvarOtherProblem.IsForeignKey = false;
				colvarOtherProblem.IsReadOnly = false;
				colvarOtherProblem.DefaultSetting = @"";
				colvarOtherProblem.ForeignKeyTableName = "";
				schema.Columns.Add(colvarOtherProblem);
				
				TableSchema.TableColumn colvarEnteringUserID = new TableSchema.TableColumn(schema);
				colvarEnteringUserID.ColumnName = "EnteringUserID";
				colvarEnteringUserID.DataType = DbType.Int32;
				colvarEnteringUserID.MaxLength = 0;
				colvarEnteringUserID.AutoIncrement = false;
				colvarEnteringUserID.IsNullable = true;
				colvarEnteringUserID.IsPrimaryKey = false;
				colvarEnteringUserID.IsForeignKey = false;
				colvarEnteringUserID.IsReadOnly = false;
				colvarEnteringUserID.DefaultSetting = @"";
				colvarEnteringUserID.ForeignKeyTableName = "";
				schema.Columns.Add(colvarEnteringUserID);
				
				TableSchema.TableColumn colvarADeptMasterID = new TableSchema.TableColumn(schema);
				colvarADeptMasterID.ColumnName = "aDept_MasterID";
				colvarADeptMasterID.DataType = DbType.Int32;
				colvarADeptMasterID.MaxLength = 0;
				colvarADeptMasterID.AutoIncrement = false;
				colvarADeptMasterID.IsNullable = true;
				colvarADeptMasterID.IsPrimaryKey = false;
				colvarADeptMasterID.IsForeignKey = false;
				colvarADeptMasterID.IsReadOnly = false;
				colvarADeptMasterID.DefaultSetting = @"";
				colvarADeptMasterID.ForeignKeyTableName = "";
				schema.Columns.Add(colvarADeptMasterID);
				
				TableSchema.TableColumn colvarADeptMasterRemark = new TableSchema.TableColumn(schema);
				colvarADeptMasterRemark.ColumnName = "aDept_Master_Remark";
				colvarADeptMasterRemark.DataType = DbType.String;
				colvarADeptMasterRemark.MaxLength = 1073741823;
				colvarADeptMasterRemark.AutoIncrement = false;
				colvarADeptMasterRemark.IsNullable = true;
				colvarADeptMasterRemark.IsPrimaryKey = false;
				colvarADeptMasterRemark.IsForeignKey = false;
				colvarADeptMasterRemark.IsReadOnly = false;
				colvarADeptMasterRemark.DefaultSetting = @"";
				colvarADeptMasterRemark.ForeignKeyTableName = "";
				schema.Columns.Add(colvarADeptMasterRemark);
				
				TableSchema.TableColumn colvarADeptMasterStatus = new TableSchema.TableColumn(schema);
				colvarADeptMasterStatus.ColumnName = "aDept_Master_Status";
				colvarADeptMasterStatus.DataType = DbType.Int32;
				colvarADeptMasterStatus.MaxLength = 0;
				colvarADeptMasterStatus.AutoIncrement = false;
				colvarADeptMasterStatus.IsNullable = true;
				colvarADeptMasterStatus.IsPrimaryKey = false;
				colvarADeptMasterStatus.IsForeignKey = false;
				colvarADeptMasterStatus.IsReadOnly = false;
				colvarADeptMasterStatus.DefaultSetting = @"";
				colvarADeptMasterStatus.ForeignKeyTableName = "";
				schema.Columns.Add(colvarADeptMasterStatus);
				
				TableSchema.TableColumn colvarADeptMasterEnteringTime = new TableSchema.TableColumn(schema);
				colvarADeptMasterEnteringTime.ColumnName = "aDept_Master_Entering_time";
				colvarADeptMasterEnteringTime.DataType = DbType.DateTime;
				colvarADeptMasterEnteringTime.MaxLength = 0;
				colvarADeptMasterEnteringTime.AutoIncrement = false;
				colvarADeptMasterEnteringTime.IsNullable = true;
				colvarADeptMasterEnteringTime.IsPrimaryKey = false;
				colvarADeptMasterEnteringTime.IsForeignKey = false;
				colvarADeptMasterEnteringTime.IsReadOnly = false;
				colvarADeptMasterEnteringTime.DefaultSetting = @"";
				colvarADeptMasterEnteringTime.ForeignKeyTableName = "";
				schema.Columns.Add(colvarADeptMasterEnteringTime);
				
				TableSchema.TableColumn colvarDeptMasterId = new TableSchema.TableColumn(schema);
				colvarDeptMasterId.ColumnName = "Dept_Master_ID";
				colvarDeptMasterId.DataType = DbType.Int32;
				colvarDeptMasterId.MaxLength = 0;
				colvarDeptMasterId.AutoIncrement = false;
				colvarDeptMasterId.IsNullable = true;
				colvarDeptMasterId.IsPrimaryKey = false;
				colvarDeptMasterId.IsForeignKey = false;
				colvarDeptMasterId.IsReadOnly = false;
				colvarDeptMasterId.DefaultSetting = @"";
				colvarDeptMasterId.ForeignKeyTableName = "";
				schema.Columns.Add(colvarDeptMasterId);
				
				TableSchema.TableColumn colvarDeptMasterRemark = new TableSchema.TableColumn(schema);
				colvarDeptMasterRemark.ColumnName = "Dept_Master_Remark";
				colvarDeptMasterRemark.DataType = DbType.String;
				colvarDeptMasterRemark.MaxLength = 1073741823;
				colvarDeptMasterRemark.AutoIncrement = false;
				colvarDeptMasterRemark.IsNullable = true;
				colvarDeptMasterRemark.IsPrimaryKey = false;
				colvarDeptMasterRemark.IsForeignKey = false;
				colvarDeptMasterRemark.IsReadOnly = false;
				colvarDeptMasterRemark.DefaultSetting = @"";
				colvarDeptMasterRemark.ForeignKeyTableName = "";
				schema.Columns.Add(colvarDeptMasterRemark);
				
				TableSchema.TableColumn colvarDeptMasterStatus = new TableSchema.TableColumn(schema);
				colvarDeptMasterStatus.ColumnName = "Dept_Master_Status";
				colvarDeptMasterStatus.DataType = DbType.Int32;
				colvarDeptMasterStatus.MaxLength = 0;
				colvarDeptMasterStatus.AutoIncrement = false;
				colvarDeptMasterStatus.IsNullable = true;
				colvarDeptMasterStatus.IsPrimaryKey = false;
				colvarDeptMasterStatus.IsForeignKey = false;
				colvarDeptMasterStatus.IsReadOnly = false;
				colvarDeptMasterStatus.DefaultSetting = @"";
				colvarDeptMasterStatus.ForeignKeyTableName = "";
				schema.Columns.Add(colvarDeptMasterStatus);
				
				TableSchema.TableColumn colvarDeptMasterEnteringTime = new TableSchema.TableColumn(schema);
				colvarDeptMasterEnteringTime.ColumnName = "Dept_Master_Entering_Time";
				colvarDeptMasterEnteringTime.DataType = DbType.DateTime;
				colvarDeptMasterEnteringTime.MaxLength = 0;
				colvarDeptMasterEnteringTime.AutoIncrement = false;
				colvarDeptMasterEnteringTime.IsNullable = true;
				colvarDeptMasterEnteringTime.IsPrimaryKey = false;
				colvarDeptMasterEnteringTime.IsForeignKey = false;
				colvarDeptMasterEnteringTime.IsReadOnly = false;
				colvarDeptMasterEnteringTime.DefaultSetting = @"";
				colvarDeptMasterEnteringTime.ForeignKeyTableName = "";
				schema.Columns.Add(colvarDeptMasterEnteringTime);
				
				TableSchema.TableColumn colvarBossUserID = new TableSchema.TableColumn(schema);
				colvarBossUserID.ColumnName = "Boss_UserID";
				colvarBossUserID.DataType = DbType.Int32;
				colvarBossUserID.MaxLength = 0;
				colvarBossUserID.AutoIncrement = false;
				colvarBossUserID.IsNullable = true;
				colvarBossUserID.IsPrimaryKey = false;
				colvarBossUserID.IsForeignKey = false;
				colvarBossUserID.IsReadOnly = false;
				colvarBossUserID.DefaultSetting = @"";
				colvarBossUserID.ForeignKeyTableName = "";
				schema.Columns.Add(colvarBossUserID);
				
				TableSchema.TableColumn colvarBossRemark = new TableSchema.TableColumn(schema);
				colvarBossRemark.ColumnName = "Boss_Remark";
				colvarBossRemark.DataType = DbType.String;
				colvarBossRemark.MaxLength = 1073741823;
				colvarBossRemark.AutoIncrement = false;
				colvarBossRemark.IsNullable = true;
				colvarBossRemark.IsPrimaryKey = false;
				colvarBossRemark.IsForeignKey = false;
				colvarBossRemark.IsReadOnly = false;
				colvarBossRemark.DefaultSetting = @"";
				colvarBossRemark.ForeignKeyTableName = "";
				schema.Columns.Add(colvarBossRemark);
				
				TableSchema.TableColumn colvarBossStatus = new TableSchema.TableColumn(schema);
				colvarBossStatus.ColumnName = "Boss_Status";
				colvarBossStatus.DataType = DbType.Int32;
				colvarBossStatus.MaxLength = 0;
				colvarBossStatus.AutoIncrement = false;
				colvarBossStatus.IsNullable = true;
				colvarBossStatus.IsPrimaryKey = false;
				colvarBossStatus.IsForeignKey = false;
				colvarBossStatus.IsReadOnly = false;
				colvarBossStatus.DefaultSetting = @"";
				colvarBossStatus.ForeignKeyTableName = "";
				schema.Columns.Add(colvarBossStatus);
				
				TableSchema.TableColumn colvarBossTime = new TableSchema.TableColumn(schema);
				colvarBossTime.ColumnName = "Boss_Time";
				colvarBossTime.DataType = DbType.DateTime;
				colvarBossTime.MaxLength = 0;
				colvarBossTime.AutoIncrement = false;
				colvarBossTime.IsNullable = true;
				colvarBossTime.IsPrimaryKey = false;
				colvarBossTime.IsForeignKey = false;
				colvarBossTime.IsReadOnly = false;
				colvarBossTime.DefaultSetting = @"";
				colvarBossTime.ForeignKeyTableName = "";
				schema.Columns.Add(colvarBossTime);
				
				TableSchema.TableColumn colvarInTime = new TableSchema.TableColumn(schema);
				colvarInTime.ColumnName = "inTime";
				colvarInTime.DataType = DbType.DateTime;
				colvarInTime.MaxLength = 0;
				colvarInTime.AutoIncrement = false;
				colvarInTime.IsNullable = true;
				colvarInTime.IsPrimaryKey = false;
				colvarInTime.IsForeignKey = false;
				colvarInTime.IsReadOnly = false;
				
						colvarInTime.DefaultSetting = @"(getdate())";
				colvarInTime.ForeignKeyTableName = "";
				schema.Columns.Add(colvarInTime);
				
				TableSchema.TableColumn colvarStatus = new TableSchema.TableColumn(schema);
				colvarStatus.ColumnName = "Status";
				colvarStatus.DataType = DbType.Int32;
				colvarStatus.MaxLength = 0;
				colvarStatus.AutoIncrement = false;
				colvarStatus.IsNullable = true;
				colvarStatus.IsPrimaryKey = false;
				colvarStatus.IsForeignKey = false;
				colvarStatus.IsReadOnly = false;
				colvarStatus.DefaultSetting = @"";
				colvarStatus.ForeignKeyTableName = "";
				schema.Columns.Add(colvarStatus);
				
				TableSchema.TableColumn colvarGuid = new TableSchema.TableColumn(schema);
				colvarGuid.ColumnName = "Guid";
				colvarGuid.DataType = DbType.Guid;
				colvarGuid.MaxLength = 0;
				colvarGuid.AutoIncrement = false;
				colvarGuid.IsNullable = true;
				colvarGuid.IsPrimaryKey = false;
				colvarGuid.IsForeignKey = false;
				colvarGuid.IsReadOnly = false;
				colvarGuid.DefaultSetting = @"";
				colvarGuid.ForeignKeyTableName = "";
				schema.Columns.Add(colvarGuid);
				
				BaseSchema = schema;
				//add this schema to the provider
				//so we can query it later
				DataService.Providers["CXDB"].AddSchema("CX_Staff_HR",schema);
			}
		}
		#endregion
		
		#region Props
		  
		[XmlAttribute("Id")]
		[Bindable(true)]
		public int Id 
		{
			get { return GetColumnValue<int>(Columns.Id); }
			set { SetColumnValue(Columns.Id, value); }
		}
		  
		[XmlAttribute("UserID")]
		[Bindable(true)]
		public int? UserID 
		{
			get { return GetColumnValue<int?>(Columns.UserID); }
			set { SetColumnValue(Columns.UserID, value); }
		}
		  
		[XmlAttribute("DeptID")]
		[Bindable(true)]
		public int? DeptID 
		{
			get { return GetColumnValue<int?>(Columns.DeptID); }
			set { SetColumnValue(Columns.DeptID, value); }
		}
		  
		[XmlAttribute("TalkTime")]
		[Bindable(true)]
		public DateTime? TalkTime 
		{
			get { return GetColumnValue<DateTime?>(Columns.TalkTime); }
			set { SetColumnValue(Columns.TalkTime, value); }
		}
		  
		[XmlAttribute("TalkContent")]
		[Bindable(true)]
		public string TalkContent 
		{
			get { return GetColumnValue<string>(Columns.TalkContent); }
			set { SetColumnValue(Columns.TalkContent, value); }
		}
		  
		[XmlAttribute("PunishPartyTime")]
		[Bindable(true)]
		public DateTime? PunishPartyTime 
		{
			get { return GetColumnValue<DateTime?>(Columns.PunishPartyTime); }
			set { SetColumnValue(Columns.PunishPartyTime, value); }
		}
		  
		[XmlAttribute("PunishPartyType")]
		[Bindable(true)]
		public string PunishPartyType 
		{
			get { return GetColumnValue<string>(Columns.PunishPartyType); }
			set { SetColumnValue(Columns.PunishPartyType, value); }
		}
		  
		[XmlAttribute("PunishPartyReason")]
		[Bindable(true)]
		public string PunishPartyReason 
		{
			get { return GetColumnValue<string>(Columns.PunishPartyReason); }
			set { SetColumnValue(Columns.PunishPartyReason, value); }
		}
		  
		[XmlAttribute("PunishPenalTime")]
		[Bindable(true)]
		public DateTime? PunishPenalTime 
		{
			get { return GetColumnValue<DateTime?>(Columns.PunishPenalTime); }
			set { SetColumnValue(Columns.PunishPenalTime, value); }
		}
		  
		[XmlAttribute("PunishPenalType")]
		[Bindable(true)]
		public string PunishPenalType 
		{
			get { return GetColumnValue<string>(Columns.PunishPenalType); }
			set { SetColumnValue(Columns.PunishPenalType, value); }
		}
		  
		[XmlAttribute("PunishPenalReason")]
		[Bindable(true)]
		public string PunishPenalReason 
		{
			get { return GetColumnValue<string>(Columns.PunishPenalReason); }
			set { SetColumnValue(Columns.PunishPenalReason, value); }
		}
		  
		[XmlAttribute("PartyProblem")]
		[Bindable(true)]
		public string PartyProblem 
		{
			get { return GetColumnValue<string>(Columns.PartyProblem); }
			set { SetColumnValue(Columns.PartyProblem, value); }
		}
		  
		[XmlAttribute("OtherProblem")]
		[Bindable(true)]
		public string OtherProblem 
		{
			get { return GetColumnValue<string>(Columns.OtherProblem); }
			set { SetColumnValue(Columns.OtherProblem, value); }
		}
		  
		[XmlAttribute("EnteringUserID")]
		[Bindable(true)]
		public int? EnteringUserID 
		{
			get { return GetColumnValue<int?>(Columns.EnteringUserID); }
			set { SetColumnValue(Columns.EnteringUserID, value); }
		}
		  
		[XmlAttribute("ADeptMasterID")]
		[Bindable(true)]
		public int? ADeptMasterID 
		{
			get { return GetColumnValue<int?>(Columns.ADeptMasterID); }
			set { SetColumnValue(Columns.ADeptMasterID, value); }
		}
		  
		[XmlAttribute("ADeptMasterRemark")]
		[Bindable(true)]
		public string ADeptMasterRemark 
		{
			get { return GetColumnValue<string>(Columns.ADeptMasterRemark); }
			set { SetColumnValue(Columns.ADeptMasterRemark, value); }
		}
		  
		[XmlAttribute("ADeptMasterStatus")]
		[Bindable(true)]
		public int? ADeptMasterStatus 
		{
			get { return GetColumnValue<int?>(Columns.ADeptMasterStatus); }
			set { SetColumnValue(Columns.ADeptMasterStatus, value); }
		}
		  
		[XmlAttribute("ADeptMasterEnteringTime")]
		[Bindable(true)]
		public DateTime? ADeptMasterEnteringTime 
		{
			get { return GetColumnValue<DateTime?>(Columns.ADeptMasterEnteringTime); }
			set { SetColumnValue(Columns.ADeptMasterEnteringTime, value); }
		}
		  
		[XmlAttribute("DeptMasterId")]
		[Bindable(true)]
		public int? DeptMasterId 
		{
			get { return GetColumnValue<int?>(Columns.DeptMasterId); }
			set { SetColumnValue(Columns.DeptMasterId, value); }
		}
		  
		[XmlAttribute("DeptMasterRemark")]
		[Bindable(true)]
		public string DeptMasterRemark 
		{
			get { return GetColumnValue<string>(Columns.DeptMasterRemark); }
			set { SetColumnValue(Columns.DeptMasterRemark, value); }
		}
		  
		[XmlAttribute("DeptMasterStatus")]
		[Bindable(true)]
		public int? DeptMasterStatus 
		{
			get { return GetColumnValue<int?>(Columns.DeptMasterStatus); }
			set { SetColumnValue(Columns.DeptMasterStatus, value); }
		}
		  
		[XmlAttribute("DeptMasterEnteringTime")]
		[Bindable(true)]
		public DateTime? DeptMasterEnteringTime 
		{
			get { return GetColumnValue<DateTime?>(Columns.DeptMasterEnteringTime); }
			set { SetColumnValue(Columns.DeptMasterEnteringTime, value); }
		}
		  
		[XmlAttribute("BossUserID")]
		[Bindable(true)]
		public int? BossUserID 
		{
			get { return GetColumnValue<int?>(Columns.BossUserID); }
			set { SetColumnValue(Columns.BossUserID, value); }
		}
		  
		[XmlAttribute("BossRemark")]
		[Bindable(true)]
		public string BossRemark 
		{
			get { return GetColumnValue<string>(Columns.BossRemark); }
			set { SetColumnValue(Columns.BossRemark, value); }
		}
		  
		[XmlAttribute("BossStatus")]
		[Bindable(true)]
		public int? BossStatus 
		{
			get { return GetColumnValue<int?>(Columns.BossStatus); }
			set { SetColumnValue(Columns.BossStatus, value); }
		}
		  
		[XmlAttribute("BossTime")]
		[Bindable(true)]
		public DateTime? BossTime 
		{
			get { return GetColumnValue<DateTime?>(Columns.BossTime); }
			set { SetColumnValue(Columns.BossTime, value); }
		}
		  
		[XmlAttribute("InTime")]
		[Bindable(true)]
		public DateTime? InTime 
		{
			get { return GetColumnValue<DateTime?>(Columns.InTime); }
			set { SetColumnValue(Columns.InTime, value); }
		}
		  
		[XmlAttribute("Status")]
		[Bindable(true)]
		public int? Status 
		{
			get { return GetColumnValue<int?>(Columns.Status); }
			set { SetColumnValue(Columns.Status, value); }
		}
		  
		[XmlAttribute("Guid")]
		[Bindable(true)]
		public Guid? Guid 
		{
			get { return GetColumnValue<Guid?>(Columns.Guid); }
			set { SetColumnValue(Columns.Guid, value); }
		}
		
		#endregion
		
		
			
		
		//no foreign key tables defined (0)
		
		
		
		//no ManyToMany tables defined (0)
		
        
        
		#region ObjectDataSource support
		
		
		/// <summary>
		/// Inserts a record, can be used with the Object Data Source
		/// </summary>
		public static void Insert(int? varUserID,int? varDeptID,DateTime? varTalkTime,string varTalkContent,DateTime? varPunishPartyTime,string varPunishPartyType,string varPunishPartyReason,DateTime? varPunishPenalTime,string varPunishPenalType,string varPunishPenalReason,string varPartyProblem,string varOtherProblem,int? varEnteringUserID,int? varADeptMasterID,string varADeptMasterRemark,int? varADeptMasterStatus,DateTime? varADeptMasterEnteringTime,int? varDeptMasterId,string varDeptMasterRemark,int? varDeptMasterStatus,DateTime? varDeptMasterEnteringTime,int? varBossUserID,string varBossRemark,int? varBossStatus,DateTime? varBossTime,DateTime? varInTime,int? varStatus,Guid? varGuid)
		{
			CxStaffHr item = new CxStaffHr();
			
			item.UserID = varUserID;
			
			item.DeptID = varDeptID;
			
			item.TalkTime = varTalkTime;
			
			item.TalkContent = varTalkContent;
			
			item.PunishPartyTime = varPunishPartyTime;
			
			item.PunishPartyType = varPunishPartyType;
			
			item.PunishPartyReason = varPunishPartyReason;
			
			item.PunishPenalTime = varPunishPenalTime;
			
			item.PunishPenalType = varPunishPenalType;
			
			item.PunishPenalReason = varPunishPenalReason;
			
			item.PartyProblem = varPartyProblem;
			
			item.OtherProblem = varOtherProblem;
			
			item.EnteringUserID = varEnteringUserID;
			
			item.ADeptMasterID = varADeptMasterID;
			
			item.ADeptMasterRemark = varADeptMasterRemark;
			
			item.ADeptMasterStatus = varADeptMasterStatus;
			
			item.ADeptMasterEnteringTime = varADeptMasterEnteringTime;
			
			item.DeptMasterId = varDeptMasterId;
			
			item.DeptMasterRemark = varDeptMasterRemark;
			
			item.DeptMasterStatus = varDeptMasterStatus;
			
			item.DeptMasterEnteringTime = varDeptMasterEnteringTime;
			
			item.BossUserID = varBossUserID;
			
			item.BossRemark = varBossRemark;
			
			item.BossStatus = varBossStatus;
			
			item.BossTime = varBossTime;
			
			item.InTime = varInTime;
			
			item.Status = varStatus;
			
			item.Guid = varGuid;
			
		
			if (System.Web.HttpContext.Current != null)
				item.Save(System.Web.HttpContext.Current.User.Identity.Name);
			else
				item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name);
		}
		
		/// <summary>
		/// Updates a record, can be used with the Object Data Source
		/// </summary>
		public static void Update(int varId,int? varUserID,int? varDeptID,DateTime? varTalkTime,string varTalkContent,DateTime? varPunishPartyTime,string varPunishPartyType,string varPunishPartyReason,DateTime? varPunishPenalTime,string varPunishPenalType,string varPunishPenalReason,string varPartyProblem,string varOtherProblem,int? varEnteringUserID,int? varADeptMasterID,string varADeptMasterRemark,int? varADeptMasterStatus,DateTime? varADeptMasterEnteringTime,int? varDeptMasterId,string varDeptMasterRemark,int? varDeptMasterStatus,DateTime? varDeptMasterEnteringTime,int? varBossUserID,string varBossRemark,int? varBossStatus,DateTime? varBossTime,DateTime? varInTime,int? varStatus,Guid? varGuid)
		{
			CxStaffHr item = new CxStaffHr();
			
				item.Id = varId;
			
				item.UserID = varUserID;
			
				item.DeptID = varDeptID;
			
				item.TalkTime = varTalkTime;
			
				item.TalkContent = varTalkContent;
			
				item.PunishPartyTime = varPunishPartyTime;
			
				item.PunishPartyType = varPunishPartyType;
			
				item.PunishPartyReason = varPunishPartyReason;
			
				item.PunishPenalTime = varPunishPenalTime;
			
				item.PunishPenalType = varPunishPenalType;
			
				item.PunishPenalReason = varPunishPenalReason;
			
				item.PartyProblem = varPartyProblem;
			
				item.OtherProblem = varOtherProblem;
			
				item.EnteringUserID = varEnteringUserID;
			
				item.ADeptMasterID = varADeptMasterID;
			
				item.ADeptMasterRemark = varADeptMasterRemark;
			
				item.ADeptMasterStatus = varADeptMasterStatus;
			
				item.ADeptMasterEnteringTime = varADeptMasterEnteringTime;
			
				item.DeptMasterId = varDeptMasterId;
			
				item.DeptMasterRemark = varDeptMasterRemark;
			
				item.DeptMasterStatus = varDeptMasterStatus;
			
				item.DeptMasterEnteringTime = varDeptMasterEnteringTime;
			
				item.BossUserID = varBossUserID;
			
				item.BossRemark = varBossRemark;
			
				item.BossStatus = varBossStatus;
			
				item.BossTime = varBossTime;
			
				item.InTime = varInTime;
			
				item.Status = varStatus;
			
				item.Guid = varGuid;
			
			item.IsNew = false;
			if (System.Web.HttpContext.Current != null)
				item.Save(System.Web.HttpContext.Current.User.Identity.Name);
			else
				item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name);
		}
		#endregion
        
        
        
        #region Typed Columns
        
        
        public static TableSchema.TableColumn IdColumn
        {
            get { return Schema.Columns[0]; }
        }
        
        
        
        public static TableSchema.TableColumn UserIDColumn
        {
            get { return Schema.Columns[1]; }
        }
        
        
        
        public static TableSchema.TableColumn DeptIDColumn
        {
            get { return Schema.Columns[2]; }
        }
        
        
        
        public static TableSchema.TableColumn TalkTimeColumn
        {
            get { return Schema.Columns[3]; }
        }
        
        
        
        public static TableSchema.TableColumn TalkContentColumn
        {
            get { return Schema.Columns[4]; }
        }
        
        
        
        public static TableSchema.TableColumn PunishPartyTimeColumn
        {
            get { return Schema.Columns[5]; }
        }
        
        
        
        public static TableSchema.TableColumn PunishPartyTypeColumn
        {
            get { return Schema.Columns[6]; }
        }
        
        
        
        public static TableSchema.TableColumn PunishPartyReasonColumn
        {
            get { return Schema.Columns[7]; }
        }
        
        
        
        public static TableSchema.TableColumn PunishPenalTimeColumn
        {
            get { return Schema.Columns[8]; }
        }
        
        
        
        public static TableSchema.TableColumn PunishPenalTypeColumn
        {
            get { return Schema.Columns[9]; }
        }
        
        
        
        public static TableSchema.TableColumn PunishPenalReasonColumn
        {
            get { return Schema.Columns[10]; }
        }
        
        
        
        public static TableSchema.TableColumn PartyProblemColumn
        {
            get { return Schema.Columns[11]; }
        }
        
        
        
        public static TableSchema.TableColumn OtherProblemColumn
        {
            get { return Schema.Columns[12]; }
        }
        
        
        
        public static TableSchema.TableColumn EnteringUserIDColumn
        {
            get { return Schema.Columns[13]; }
        }
        
        
        
        public static TableSchema.TableColumn ADeptMasterIDColumn
        {
            get { return Schema.Columns[14]; }
        }
        
        
        
        public static TableSchema.TableColumn ADeptMasterRemarkColumn
        {
            get { return Schema.Columns[15]; }
        }
        
        
        
        public static TableSchema.TableColumn ADeptMasterStatusColumn
        {
            get { return Schema.Columns[16]; }
        }
        
        
        
        public static TableSchema.TableColumn ADeptMasterEnteringTimeColumn
        {
            get { return Schema.Columns[17]; }
        }
        
        
        
        public static TableSchema.TableColumn DeptMasterIdColumn
        {
            get { return Schema.Columns[18]; }
        }
        
        
        
        public static TableSchema.TableColumn DeptMasterRemarkColumn
        {
            get { return Schema.Columns[19]; }
        }
        
        
        
        public static TableSchema.TableColumn DeptMasterStatusColumn
        {
            get { return Schema.Columns[20]; }
        }
        
        
        
        public static TableSchema.TableColumn DeptMasterEnteringTimeColumn
        {
            get { return Schema.Columns[21]; }
        }
        
        
        
        public static TableSchema.TableColumn BossUserIDColumn
        {
            get { return Schema.Columns[22]; }
        }
        
        
        
        public static TableSchema.TableColumn BossRemarkColumn
        {
            get { return Schema.Columns[23]; }
        }
        
        
        
        public static TableSchema.TableColumn BossStatusColumn
        {
            get { return Schema.Columns[24]; }
        }
        
        
        
        public static TableSchema.TableColumn BossTimeColumn
        {
            get { return Schema.Columns[25]; }
        }
        
        
        
        public static TableSchema.TableColumn InTimeColumn
        {
            get { return Schema.Columns[26]; }
        }
        
        
        
        public static TableSchema.TableColumn StatusColumn
        {
            get { return Schema.Columns[27]; }
        }
        
        
        
        public static TableSchema.TableColumn GuidColumn
        {
            get { return Schema.Columns[28]; }
        }
        
        
        
        #endregion
		#region Columns Struct
		public struct Columns
		{
			 public static string Id = @"ID";
			 public static string UserID = @"userID";
			 public static string DeptID = @"DeptID";
			 public static string TalkTime = @"TalkTime";
			 public static string TalkContent = @"TalkContent";
			 public static string PunishPartyTime = @"Punish_party_time";
			 public static string PunishPartyType = @"Punish_party_type";
			 public static string PunishPartyReason = @"Punish_party_reason";
			 public static string PunishPenalTime = @"Punish_penal_time";
			 public static string PunishPenalType = @"Punish_penal_type";
			 public static string PunishPenalReason = @"Punish_penal_reason";
			 public static string PartyProblem = @"Party_Problem";
			 public static string OtherProblem = @"Other_Problem";
			 public static string EnteringUserID = @"EnteringUserID";
			 public static string ADeptMasterID = @"aDept_MasterID";
			 public static string ADeptMasterRemark = @"aDept_Master_Remark";
			 public static string ADeptMasterStatus = @"aDept_Master_Status";
			 public static string ADeptMasterEnteringTime = @"aDept_Master_Entering_time";
			 public static string DeptMasterId = @"Dept_Master_ID";
			 public static string DeptMasterRemark = @"Dept_Master_Remark";
			 public static string DeptMasterStatus = @"Dept_Master_Status";
			 public static string DeptMasterEnteringTime = @"Dept_Master_Entering_Time";
			 public static string BossUserID = @"Boss_UserID";
			 public static string BossRemark = @"Boss_Remark";
			 public static string BossStatus = @"Boss_Status";
			 public static string BossTime = @"Boss_Time";
			 public static string InTime = @"inTime";
			 public static string Status = @"Status";
			 public static string Guid = @"Guid";
						
		}
		#endregion
		
		#region Update PK Collections
		
        #endregion
    
        #region Deep Save
		
        #endregion
	}
}
